package com.qf.controller;

import com.qf.pojo.DtsAccountTrace;
import com.qf.service.DtsAccountTraceService;
import com.qf.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/admin/brokerage")
public class DtsAdminBrokerageController {
//
    @Autowired
    DtsAccountTraceService accountTraceService;

    @PostMapping("/approve")
    public Object approve(@RequestBody DtsAccountTrace account) {
        accountTraceService.update(account);
        return ResponseUtil.ok();

    }

    @GetMapping("/list")
    public Object list(
            @RequestParam(value = "page",required = false, defaultValue = "1") Integer page,
            @RequestParam(value = "limit",required = false, defaultValue = "20")Integer limit,
            String username,String mobile,Integer statusArray,String sort,String order
    ){
        Map<String, Object> data = accountTraceService.queryPage(page,limit,username,mobile,statusArray,sort,order);
        return ResponseUtil.ok(data);
    }
}